//bange_layer.hpp
//Copyright (C) 2010-2011 Oscar (.teri) Triano

//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _bange_layer_
#define _bange_layer_

#include <cstring>
#include <SFML/Graphics.hpp>
#include <lua5.1/lua.hpp>
#include <chipmunk/chipmunk.h>
#include <bange_behavior.hpp>

namespace bange{
	
	class layer: public bange::behavior{
		public:		
			enum layertype{
				None,
				Image,
				Object,
				SimpleObject,
				Color,
				Tilemap,
				PostFX
			};		
		protected:
			bange::layer::layertype type;
			bool processlayer;
		public:
			mutable cpSpace *scenespace;
			mutable bool visible;
			
			layer(cpSpace *, lua_State *);
			virtual bool NewIndex(lua_State *);
			virtual bool Index(lua_State *);
			virtual void ManageEvent(int indexlayer, int indexevent, sf::Event &, lua_State *) = 0;
			virtual void Process(int, float, lua_State *) = 0;
			virtual void Draw(sf::RenderWindow *, sf::View &) = 0;
			void SetVisible(bool);
			bool GetVisible(void);
			virtual void CleanVM(lua_State *);
			virtual ~layer();

			static void RegisterVM(lua_State *);
			
	};

	//typedef int inttest;

}

#endif
